package com.mk.carcassonne;

import com.mk.carcassonne.drawables.CommandBar;

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;

public class Game extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.main);
        
        GlobalData.init();
        Global.init(this);
        
        GlobalData.setNextBrick(Global.BrickRepository.getNext());
        
        Panel container = (Panel)findViewById(R.id.GameArea);
        container.setUpShift();
        CommandBar commandBar = new CommandBar(R.drawable.command_bar_bg);
        commandBar.setNextBrick(GlobalData.getNextBrick());
        container.setCommandBar(commandBar);
        
        GlobalData.addPlacedBrick(Global.BrickRepository.getStartBrick());
        GlobalData.addBrickPlacement(new Position(0, 0));
    }
}